define([
    "jQuery",
	"app/data",
	"app/views/home"
	], function (
    $,
	data,
	homeView
	) {

    return {
        init: function () {
			console.log('App home init.. ');
			
			App.data.classGroups[1] = ["Pi Group","Radiant Group"];
			App.data.classGroupsId[1] = ["3","4"];
			App.data.classGroups[2] = ["Newton Group"];
			App.data.classGroupsId[2] = ["5"];
			
			App.views.home.init();
		},
		
		classChanged: function (classId){
			var selectObject = document.getElementById("group_select");
			var originalLength = selectObject.options.length;
			for(i=0;i<originalLength;i++)
			{
				selectObject.remove(0);
			}
			// alert(classGroups[classId]);
			for(i=0;i<App.data.classGroups[classId].length;i++)
			{
				
				var option=document.createElement("option");
				option.text=App.data.classGroups[classId][i];
				option.value=App.data.classGroupsId[classId][i];
				
				selectObject.add(option);
			}
		},
		
		submitClicked: function(){
			var groupSelect = document.getElementById("group_select");
			var classSelect = document.getElementById("class_select");
			if(classSelect.selectedIndex == -1 || groupSelect.selectedIndex == -1)
			{
				alert("Please select class and group");
			}
		},
		
		data: data,
		
		views : {
			home: homeView
		}
	}
});